package com.leoncom.sms_silencer.util;

import com.leoncom.sms_sliencer.R;

import android.content.Context;
import android.media.AudioManager;

public class MuterHelper {
	
	private static int ACTION_NOTIFY_ID = 23927;
	
	public static void setToMute(Context context) {
		AudioManager am = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
		am.setStreamMute(AudioManager.STREAM_NOTIFICATION, true);
		NotifyManagerHelper.notifyMessage(context, 
				context.getResources().getString(R.string.MuteTitle), 
				context.getResources().getString(R.string.MuteContent),
				ACTION_NOTIFY_ID);
	}

	public static void setToUnMute(Context context) {
		AudioManager am = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
		am.setStreamMute(AudioManager.STREAM_NOTIFICATION, false);
		NotifyManagerHelper.notifyMessage(context, 
				context.getResources().getString(R.string.UnMuteTitle), 
				context.getResources().getString(R.string.UnMuteContent),
				ACTION_NOTIFY_ID);
	}
}
